﻿using MaterialDesignThemes.Wpf;
using System.Windows;
using System.Windows.Shell;
namespace Pricing
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        WindowChrome windowChrome;
        public MainWindow()
        {
            InitializeComponent();
            windowChrome = new WindowChrome() {
                NonClientFrameEdges = (NonClientFrameEdges)13,
                UseAeroCaptionButtons = false,
                CaptionHeight = 24,
            };
            
            WindowChrome.SetWindowChrome(this, windowChrome);
            MaxHeight = SystemParameters.WorkArea.Height + 15;
            MaxWidth = SystemParameters.WorkArea.Width + 15;
            

        }
        private void NonClientClick(object sender, RoutedEventArgs e)
        {
            if (sender == close)
            {
                Close();
            }
            else if (sender == maxi)
            {
                if (WindowState == WindowState.Maximized)
                {
                    WindowChrome.SetWindowChrome(this, windowChrome);
                    WindowState = WindowState.Normal;
                    restore.Visibility = Visibility.Collapsed;
                    maxiaze.Visibility = Visibility.Visible;
                }
                else
                {
                    WindowChrome.SetWindowChrome(this, null);
                    WindowState = WindowState.Maximized;
                    restore.Visibility = Visibility.Visible;
                    maxiaze.Visibility = Visibility.Collapsed;
                }
            }
            else if (sender == mini)
            {
                WindowState = WindowState.Minimized;

            }
        }

        private void Init(object sender, System.EventArgs e)
        {
        }
    }
}
